package com.edgardeng.education.entity;

import java.io.Serializable;

public class JsonResponse implements Serializable {
    private int error;
    private String message;

    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    public static JsonResponse result(boolean success) {
        JsonResponse r = new JsonResponse();
        r.setError(success ? 0:1);
        r.setMessage(success ? "success" : "fail");
        return  r;
    }
}
